#include "stack_named.h"
#include <stdio.h>

int main(void)
{
    int     s32Val = 0;
    int     s32Buf[20];
    struct stack_named stack_named;
    struct stack_named *p_stack_name = &stack_named;

    stack_named_init(p_stack_name, s32Buf, 20, "sys_stack");

    printf("This stack name is [%s]\n", stack_named_get(p_stack_name));
    

    int i = 0;
    for( i = 0;i < 10; i+=2 ) {
        /*stack_push((struct stack*)p_stack_name, i);*/
        stack_push(&p_stack_name->super, i);
    }


    for( i = 0;i < 10; i+=2 ) {
        /*stack_pop((struct stack*)p_stack_name,&s32Val );*/
        stack_pop(&p_stack_name->super, &s32Val);
        printf("[%d]\n", s32Val);
    }


    printf("====================================\n");

    for(i = 0;i < 20; i+=3) {
        stack_named_push(p_stack_name, i);
    }

    for(i = 0;i < 20; i+=3) {
        stack_named_pop(p_stack_name, &s32Val);
        printf("[%d]\n", s32Val);
    }


    return 0;
}
